/*! COPYRIGHT @2015.05 WWW.CID-STUDIO.COM */

var winW, winH, allW, allH;

function remove_px(val){
	return val.substr(0,val.indexOf("px"));
}
function geturl_name(){
	var str=location.pathname;
	a=str.substr(str.lastIndexOf("/")+1)
	return a;
}
$(document).ready(function(){
	
//	$('#box-list').BlocksIt({
//		numOfCol:2,
//		offsetX: 8,
//		offsetY: 8
//	});

	autosize();
    $(window).resize(function(){
	    autosize();
    })
    
	//首页
	$("#btn_start").click(function(){
		$(".home").hide();
		$(".game").show();
	})
	
	var obj_list = '.home-wheel01|.home-wheel02|.home-hill01|.home-hill02|.home-cloud-01|.home-cloud-02|.home-cloud-03';
	var class_list = 'ani-lun|ani-lun|ani-hill-01|ani-hill-02|ani-cloud-01|ani-cloud-02|ani-cloud-03';
	fun_class(obj_list, class_list, "add");
	$(".home-moto").addClass("fadeInLeftBig animated");
	
})


//屏幕自适应
function autosize(){
	winW = $(window).width();
	winH = $(window).height();
	allW = document.body.scrollWidth;
	allH = document.body.scrollHeight;
	
	//home-01
	var home_titleH = $(".home-header").height();
	//$(".home-floor").height(winH - home_titleH);
	$(".home-floor").height(winH);
}


//动画控制
function remove_allclass() {
	var obj_list = '.home-wheel01|.home-wheel02|.home-hill01|.home-hill02|.home-cloud-01|.home-cloud-02|.home-cloud-03';
	var class_list = 'ani-lun|ani-lun|ani-hill-01|ani-hill-02|ani-cloud-01|ani-cloud-02|ani-cloud-03';	
	fun_class(obj_list, class_list, "remove");
}

function fun_class(obj_list, class_list, type) {
	var obj_arr = obj_list.split("|");
	var class_arr = class_list.split("|");
	for (var i = 0; i < obj_arr.length; i++) {
		if (type == "add") {
			$(obj_arr[i]).addClass(class_arr[i]);
		} else if (type == "remove") {
			$(obj_arr[i]).removeClass(class_arr[i]);
		}
	}
}






















